package br.com.millenium.service.funcionario.processaction;

import br.com.millenium.domain.manager.MilleniumManagerFactory;
import lumis.doui.processaction.ProcessActionHandler;
import lumis.portal.PortalException;


@SuppressWarnings("rawtypes")
public class CheckDuplicateCargoProcessActionHandler extends ProcessActionHandler
{
	@Override
	public void processAction() throws PortalException 
	{
		String cargoNome = (String)getParameter ( "nome" );
		String cargoId   = (String)(getParameter( "id"   ) == null ? "" : getParameter( "id" ));
		
		if( MilleniumManagerFactory.getFuncionarioManager().isDuplicateCargo( cargoId, cargoNome, transaction))
			throw new PortalException( "STR_CARGO_EXISTS;", getResource() );
	}
}
